package exam;



import java.util.Scanner;

public class demo02 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入数据字符串");
        while (scanner.hasNext()){
            String dataString = scanner.nextLine();
            System.out.println("请输入目标字符串");
            String aimString = scanner.nextLine();
            if (dataString == null || aimString == null || dataString.length() < aimString.length()){
                return;
            }
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < dataString.length(); i++) {
                if (!aimString.contains(dataString.subSequence(i,i+1))){
                    sb.append(dataString.charAt(i));
                }
            }
            System.out.println(sb.toString());
        }
    }
}

